#include <iostream>
#include <utility>
#include <cstdio>
#include <cstdlib>
using namespace std;
typedef unsigned long LONG;
typedef pair<LONG, LONG> Rational;

bool operator < (const Rational& x, const Rational& y) {
	return ((double)x.first/x.second < (double)y.first/y.second);
}

bool operator != (const Rational& x, const Rational& y) {
	return ((x.first != y.first) || (x.second != y.second));
}

Rational operator + (const Rational& x, const Rational& y) {
	return make_pair(x.first+y.first, x.second+y.second);	
}

/* main
 *  * */
int main() {
	Rational N = make_pair(0, 0);
	cin >> N.first >> N.second;
	do {
		Rational L = make_pair(0, 1);
		Rational R = make_pair(1, 0);
		Rational I = make_pair(1, 1);
		while( N != I) {
			if(N < I) {
				cout << "L";	
				R = I;
				I = I + L;
			} else {
				cout << "R";	
				L = I;
				I = I + R;
			}	
		}
		cout << endl;
		cin >> N.first >> N.second;
	} while(cin.eof() == false && (N.first != 1 || N.second != 1));
	return 0;
}
